package com.springcloud.client.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.logging.Logger;

@RestController
public class TraceController {

    private final Logger logger = Logger.getLogger(TraceController.class.getName());


    @GetMapping("/trace-2")
    public String trace(HttpServletRequest request) {
        logger.info("===<call trace-2, TraceId={" + request.getHeader("X-B3-TraceId") + "}, SpanId={" + request.getHeader("X-B3-SpanId") + "}>===");
        return "Trace";
    }

}